<!--Start of Home Content-->
<input type="hidden" value="<?php echo base_url()?>" id="base_url" />
<input type="hidden" value="<?php echo $this->session->userdata('user_id'); ?>" id="user_id" />
<div class="main  col1-layout">
<div class="col-main">
  <div class="std"> 
    
    <!--Start Banner-->
    <div class="banner_box">
      <div class="slider-wrapper banner"> 
        <!--Place your banner images-->
        <div id="slider" class="banner_slider"> 
            <a href="#"><img src="<?php echo base_url();?>content/images/banner1.png" alt="" /></a> 
            <a href="#"><img src="<?php echo base_url();?>content/images/banner_2.png" alt="" /></a> 
            <a href="#"><img src="<?php echo base_url();?>content/images/banner_3.png" alt="" /></a> 
            <a href="#"><img src="<?php echo base_url();?>content/images/banner_4.png" alt="" /></a> 
        </div>
      </div>
      <div class="promotional_block"> <!--Place your promotional images-->
        <!--<div class="block_one"> <a href="#"><img src="<?php echo base_url();?>content/images/promo1.jpg" alt="" /></a> </div>
        <div class="block_one"> <a href="#"><img src="<?php echo base_url();?>content/images/promo2.jpg" alt="" /></a> </div>
        -->
        <form id="form_search_restaurent" method="post" action="<?php echo base_url();?>restaurents/restaurents/search">
            <div class="location">
               <h2 class="title">
                   Chọn nơi bạn muốn nhận đồ ăn?
               </h2>
               <div>
                   <div>
                       <select name="province" id="province" title="Bạn đang ở tỉnh thành nào?" >
                           <option value="0">Chọn tỉnh thành</option>
                           <option  value="4">Hồ Chí Minh</option>
                           <option  value="2">Hà Nội</option>
                       </select>
                   </div>                   
                   <div class="district_selector" id="search_select" style="margin-left:15px;height:50px">
                       <select name="district" id="district" class="select" title="Chọn Quận">
                               <option value="0">Chọn quận</option>                            
                               <option  value="33">An Phú</option>
                               <option  value="1">Bình Chánh</option>
                               <option  value="2">Bình Tân</option>
                               <option  value="5">Bình Thạnh</option>
                               <option  value="41">Cần Giờ</option>
                               <option  value="42">Củ Chi</option>
                               <option  value="6">Gò Vấp</option>
                               <option  value="40">Hóc Môn</option>
                               <option  value="39">Nhà Bè</option>
                               <option  value="34">Phú Mỹ Hưng</option>
                               <option  value="7">Phú Nhuận</option>
                               <option  value="19">Tân Bình</option>
                               <option  value="20">Tân Phú</option>
                               <option  value="21">Thủ Đức</option>
                       </select>
                   </div>
                   <div id="submit" >
                      Chọn nhà hàng
                   </div>
                  
               </div>                        
           </div><!--end: div.location-->
        </form>
        

      </div>
    </div>
    <!--End Banner--> 
    
    <!-- Start Feartured Products -->
    
    <div class="featured-products"> 
     <h1 class="category_page_title">Món ngon trong ngày</h1>            
    <!--Start Category Product List-->
    <ul class="products-grid">
    <?php $i = 0;  ?>    
    <?php  foreach ($list_child_product as $product) {  $i++; 
        // check product in wishlist
        $user_id = $this->session->userdata('user_id');
        $product1 = new Product();                  
        $product1->where('id', $product->id);
        $product1->include_related('term_taxonomy',array('term_id','taxonomy'))
                ->where_related('term_taxonomy', 'taxonomy', 'wishlistproduct')
                ->where_related('term_taxonomy', 'user_id',$user_id);                  
                
        $count_product = $product1->count();  
        if ($count_product>0) $check_like = true; else $check_like = false;  
        if (($i % 4)!=0) {
          
    ?>            
        <li class="item first"> <a href="#" title="Lorem ipsum dolor sit amet," class="product-image"><img src="<?php echo $product->image;?>" alt="Lorem ipsum dolor sit amet,"/></a>
          <h2 class="product-name"> <a href="#" title="<?php echo $product->name; ?>"><?php echo $product->name; ?></a> </h2>
          <div class="price-box"> <span class="regular-price"> <span class="price"><?php echo number_format($product->price); ?> VNĐ</span> </span> </div>
          <div class="actions">
            <a href="<?php echo base_url(); ?>" food_id="<?php echo $product->id; ?>" class="add_to_cart add_to_cart_home"> Đặt món</a>             
            <a href="#" class="fancybox quick_view">quick view</a>            
            <div id="wishlist<?php echo $product->id; ?>" class="add-to-links">
                <?php 
                        if($check_login==false)
                        {
                ?>
                        <a class="link_login_like" href="#">Yêu thích</a>
                <?php
                        }
                        else 
                        {
                        if($check_like==false)
                        {
                ?>
                        <a class="add_product_wishlist" value="<?php echo $product->id; ?>" href="<?php echo base_url();?>">Add to wishlist</a>
                <?php 
                        }else{                    	
                ?>
                        <a class="remove_product_wishlist" value="<?php echo $product->id; ?>" href="<?php echo base_url();?>">Remove Wishlist</a>
                <?php }}?>                    	
            </div>
            
          </div>
        </li>      
    <?php } else {    ?>
         <li class="item last"> <a href="#" title="Lorem ipsum dolor sit amet," class="product-image"><img src="<?php echo $product->image;?>" alt="Lorem ipsum dolor sit amet,"/></a>
            <h2 class="product-name"> <a href="#" title="<?php echo $product->name; ?>"><?php echo $product->name; ?></a> </h2>
            <div class="price-box"> <span class="regular-price"> <span class="price"><?php echo number_format($product->price); ?> VNĐ</span> </span> </div>
            <div class="actions">                              
                <a href="<?php echo base_url(); ?>" food_id="<?php echo $product->id; ?>" class="add_to_cart add_to_cart_home"> Đặt món</a>              
                <a href="#" class="fancybox quick_view">quick view</a>
              
                <div id="wishlist<?php echo $product->id; ?>" class="add-to-links">
                <?php 
                        if($check_login==false)
                        {
                ?>
                        <a class="link_login_like" href="#">Yêu thích</a>
                <?php
                        }
                        else 
                        {
                        if($check_like==false)
                        {
                ?>
                        <a class="add_product_wishlist" value="<?php echo $product->id; ?>" href="<?php echo base_url();?>">Add to wishlist</a>
                <?php 
                        }else{                    	
                ?>
                        <a class="remove_product_wishlist" value="<?php echo $product->id; ?>" href="<?php echo base_url();?>">Remove Wishlist</a>
                <?php }}?>                    	
                </div>
            </div>
          </li>
    
    <?php }} ?>    
    </ul>
    <!--End Category Product List--> 
                 
  </div>
    
    <!-- End Featured Products -->
    
    <!--Start New Products-->
    <div class="box-center">
      <div class="special">
        <div style="visibility: visible;" id="mix_container" class="mix_container">
          <h1 class="category_page_title">Nhà hàng tiêu biểu</h1>
          <div class="mix_nav"> <span id="mix_prev" class="mix_prev">Previous</span> <span id="mix_next" class="mix_next">Next</span> </div>
          <div id="container" class="mix_wrapper">
            <ul style="position: relative;" class="mix_gallery">

            <?php $i = 0;  ?>    
            <?php  foreach ($list_child_restaurent as $restaurent) {  $i++; 
                if (($i % 5)!=0) {
            ?>            
            <li class="item mix_row">
                <div class="outer box"> <a href="<?php echo base_url().'restaurents/restaurents/detail/'.$restaurent->id; ?>" class="product-image"><img src="<?php echo $restaurent->image;?>" alt="Imperdiet id tincidunt" /></a>
                  <div class="ic_caption">
                    <h2 class="product-name"><a href="<?php echo base_url().'restaurents/restaurents/detail/'.$restaurent->id; ?>" title="<?php echo $restaurent->description;?>"><?php echo $restaurent->description;?> </a></h2>
                   
                  </div>
                </div>
              </li>      
            <?php } else {    ?>
            <li class="item mix_row last">
                <div class="outer box"> <a href="#" class="product-image"><img src="<?php echo $restaurent->image;?>" alt="Imperdiet id tincidunt" /></a>
                  <div class="ic_caption">
                    <h2 class="product-name"><a href="#" title="Imperdiet id tincidunt ">Imperdiet id tincidunt </a></h2>
                    <div class="actions">
                      <button style="display:none;" type="button" title="Add to Cart" class="button btn-cart"> <span> <span>Add to Cart</span> </span> </button>
                      <a href="#" class="fancybox quickllook">Quick look</a>
                      <div class="price-box"> <span class="regular-price"> <span class="price">$190.00</span> </span> </div>
                    </div>
                  </div>
                </div>
              </li>

            <?php }} ?>                                                  
            </ul>
          </div>
        </div>
      </div>
    </div>
    <!--End New Products--> 
    
  </div>
</div>
</div>
<!--End of Home Content--> 
<div style="display: none;" id="back-top"> <a href="#"><img alt="" src="<?php echo base_url();?>content/images/backtop.gif" /></a> </div>